home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / SECURITY.H < prev    next >
C/C++ Source or Header  |  1992-11-27  |  3KB  |  75 lines

  1. #ifndef _SECURITY
  2. #define _SECURITY
  3.  
  4. #define ANY_HOST     "OTHER"
  5. #define ANY_COMMAND  "ALL"
  6.  
  7. /*--------------------------------------------------------------------*/
  8. /*             Directory list structed used by host table             */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. typedef enum {
  12.    ALLOW_READ,
  13.    ALLOW_WRITE,
  14.    } REMOTE_ACCESS;
  15.  
  16. struct DIRLIST {
  17.    char *path;                /* Directory we are authorizing        */
  18.    REMOTE_ACCESS priv;        /* ALLOW_READ/ALLOW_WRITE              */
  19.    boolean grant;             /* TRUE = excplitly Allow access,
  20.                                  FALSE = explicit deny access        */
  21.    } ;
  22.  
  23. /*--------------------------------------------------------------------*/
  24. /*                        Security information                        */
  25. /*--------------------------------------------------------------------*/
  26.  
  27. struct HostSecurity {
  28.       char **validate;           /* List of machines allowed to use
  29.                                     logname when calling in             */
  30.       char *myname;              /* Name to use when communicating with
  31.                                     this remote system                  */
  32.       char *pubdir;              /* Public directory to use for this
  33.                                     system                              */
  34.       char **commands;           /* Commands allowed for this system    */
  35.       struct DIRLIST *dirlist;   /* List of directories this system
  36.                                     can access                          */
  37.       size_t dirsize;            /* Size of the directory list          */
  38.       boolean request;           /* TRUE = Remote system can request
  39.                                     files FROM local system             */
  40.       boolean sendfiles;         /* TRUE = Send locally queued requests
  41.                                     when other system has called us;
  42.                                     default is FALSE, only send files
  43.                                     when we are the caller.  (Stupid
  44.                                     default if you fill in other para-
  45.                                     meters properly, but that's UUCP    */
  46.       boolean callback;          /* TRUE = Do not process work for
  47.                                     system when it calls in, but rather
  48.                                     call it back    */
  49.       boolean local;             /* TRUE = Local system, grant all
  50.                                     requests                            */
  51.       } ; /* HostSecurity */
  52.  
  53. /*--------------------------------------------------------------------*/
  54. /*                             Prototypes                             */
  55. /*--------------------------------------------------------------------*/
  56.  
  57. boolean ValidateFile( const char *input,  /* Full path name          */
  58.                       const REMOTE_ACCESS needed );
  59.  
  60. boolean ValidateHost( const char *host );
  61.  
  62. boolean ValidateCommand( const char *command);
  63.  
  64. boolean LoadSecurity( void );
  65.  
  66. struct HostSecurity *GetSecurity( struct HostTable *hostp);
  67.  
  68. /*--------------------------------------------------------------------*/
  69. /*                          Global variables                          */
  70. /*--------------------------------------------------------------------*/
  71.  
  72. extern struct HostSecurity *securep;
  73.  
  74. #endif /* ifdef _SECURITY */
  75.